#ifndef CC_YMODEM_MASTER_H
#define CC_YMODEM_MASTER_H

#include "YModemPublic.h"

#define CFG_YMODEM_MASTER				
//
#ifdef CFG_YMODEM_MASTER
typedef struct CC_YModem_Master_StateMachine tYM_Master;
extern void YM_Master_Show(tYM_Master* pObj);
extern tYM_Master* YM_Master_SCreate(uint32_t BufSz);

typedef struct YMM_Callback_API_Set{
	uint32_t (*pFileRead)(uint32_t Offset,uint32_t Len,uint8_t* pRBuf);
	int(*pExit)(tYM_Master* pObj);
}tYMM_CallBackAPI;
extern int YM_Master_BindCallback(tYM_Master* pObj,const tYMM_CallBackAPI* pAPI);
extern int YM_Master_BindSend(tYM_Master* pObj,int (*pFunc)(uint16_t,uint8_t*) );
extern int SM_YModem_Master(tYM_Master *pObj,uint16_t Len,uint8_t* pPkg);

// Para set
extern int YM_Master_SetPara(tYM_Master* pObj,tMs WaitTick,uint16_t DPkgSz);
extern int YM_Master_StartTransFile(tYM_Master* pObj,uint32_t FileSz,uint8_t* pStrFileName);

extern int YM_Master_SetFileSzMode(uint8_t HexOrDec); // 标准是HEX 格式
// Q-如何触发 远端进入 YMSlave 状态？
#endif


#endif
